#include "../include/uart.h"
#include "../include/cmd.h"
#include "../include/led.h"
#define MAX_BUFFNUM 30

int main(void)
{
    char buff[MAX_BUFFNUM];
    led_init();
    // uart_init();
    while(1)
    {
        uart_puts("\nroot# ");
        int len = uart_gets(buff,MAX_BUFFNUM);
        if(len)
        {
            cmd_t* cmdPtr = find_cmd(buff);
            if(cmdPtr)
                cmdPtr->m_func();
            else
            {
                uart_puts("\nUnknown command: ");
                uart_puts(buff);
				// uart_puts("\n");
            }
        }
    }
    return 0;
}